﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using Google.GData.Client;

namespace Astro.Core
{
    public class GoogleClientLogin
    {
        private string authToken;
        private Service service;
        private string Username;
        private string Password;

        public GoogleClientLogin(Service serviceToUse, string username, string password)
        {
            this.service = serviceToUse;
            this.Username = username;
            this.Password = password;
        }

        public string AuthenticationToken
        {
            get { return this.authToken; }
        }

        public bool RememberAuthentication
        {
            get { return true; }
        }

        public string User
        {
            get { return this.Username; }
        }

        public void Signout()
        {
            this.authToken = null;
        }

        public void Login()
        {
            this.service.setUserCredentials(Username, Password);
            this.authToken = this.service.QueryAuthenticationToken();
        }
    }
}